﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<%@ include file="/common/include/page.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="${rootPath}/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="${rootPath}/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="${rootPath}/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="${rootPath}/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="${rootPath}/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="${rootPath}/static/h-ui.admin/css/style.css" />

<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>品牌管理</title>
<style type="text/css">
	#logo{
		width: 100px;
	}
</style>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 产品管理 <span class="c-gray en">&gt;</span> 合作伙伴管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c">
		<form class="Huiform" method="post" action="${rootPath }/back/partner_add.htm" enctype="multipart/form-data">
			<input type="text" placeholder="公司名称" required name="partnerName" value="" class="input-text" style="width:220px">
			<input type="text" placeholder="公司网址" required name="partnerLink" class="input-text" style="width:220px">
			<span class="btn-upload form-group" style="vertical-align: top;">
			<input class="input-text upload-url" type="text" name="uploadfile-2" id="uploadfile-2" readonly style="width:200px">
			<a href="javascript:void();" class="btn btn-primary upload-btn"><i class="Hui-iconfont">&#xe642;</i> 上传logo</a>
			<input type="file" name="logo" class="input-file" required>&emsp;
			</span><input type="submit" class="btn btn-success" value="保存"/>
			
		</form>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> 
	
	<span class="r">共有数据：<strong>${partners.size()}</strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg">
			<thead>
				<tr class="text-c">
					<th width="70">ID</th>
					<th width="300">LOGO</th>
					<th width="300">公司名称</th>
					<th width="300">公司网址</th>
					<th width="100">操作</th>
				</tr>
			</thead>
			<tbody>
			<c:forEach items="${partners }" var="partner">
				<tr class="text-c">
					<td>${partner.id }</td>
					<td><img src="${rootPath}${partner.partnerLogo }" id="logo"></td>
					<td class="text-l"><img title="国内品牌" src="${rootPath}/static/h-ui.admin/images/cn.gif">${partner.partnerName }</td>
					<td class="text-l">${partner.partnerLink}</td>
					<td class="f-14 product-brand-manage">
					<a style="text-decoration:none" onClick="layer_show('合作伙伴编辑','${rootPath}/back/codeing.htm?id=${partner.id }');" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> <a style="text-decoration:none" class="ml-5" onClick="partner_del(this,'${partner.id}')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
				</tr>
			</c:forEach>
			</tbody>
		</table>
	</div>
	<nav aria-label="Page navigation" style="text-align: center;">
	  <ul class="pagination pagination-lg">
	    <li>
			<a href="${rootPath }/back/product-partner.htm?currentPage=${pageInfoUtil.prePage}" aria-label="Previous">
				<span aria-hidden="true">&laquo;</span>
			</a>
		</li>
		<c:forEach begin="${pageInfoUtil.prePage}" end="${pageInfoUtil.nextPage>5?5:pageInfoUtil.nextPage}" var="page">
		    <li><a href="${rootPath }/back/product-partner.htm?currentPage=${page}">${page }</a></li>
		</c:forEach>
	    <li>
			<a href="${rootPath }/back/product-partner.htm?currentPage=${pageInfoUtil.nextPage}" aria-label="Next">
				<span aria-hidden="true">&raquo;</span>
		    </a>
	    </li>
	  </ul>
	</nav>
	
</div>


<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="${rootPath}/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${rootPath}/js/jquery.cookie.js"></script> 
<script type="text/javascript" src="${rootPath}/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="${rootPath}/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="${rootPath}/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
<script type="text/javascript" src="${rootPath}/bootstrap/js/bootstrap.min.js"></script>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="${rootPath}/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="${rootPath}/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="${rootPath}/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
if(window.top!=window.parent){
	window.parent.location.href=location.href;
}
/*合作伙伴-删除*/
function partner_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: "${rootPath}/back/partner_delete.htm?id="+id,
			/* dataType: 'json', */
			success: function(data){
				layer.msg('已删除!',{icon:1,time:1000});
				window.location.href="${rootPath}/back/product-partner.htm"
			},
			error:function(data) {
				console.log(data.msg);
			},
		});		
	});
}

</script>
</body>
</html>